Skip to content

tests: Test line number in debuginfo for diverging function calls #144034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Jul 16, 2025

Closes #59558 which just E-needs-test.

The bug seems to have been fixed in nightly-2021-05-10:

for toolchain in nightly-2021-05-09 \
                 nightly-2021-05-10 \
                 1.88; do
    echo -e "\nWith $toolchain:"
    rustc +$toolchain tests/codegen/diverging-function-call-debuginfo.rs --emit llvm-ir -o /tmp/out.ll -g -Clto -Copt-level=0
    build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck --input-file /tmp/out.ll tests/codegen/diverging-function-call-debuginfo.rs --check-prefix=CHECK --dump-input-context 10 2>/dev/null && echo OK || echo FAIL
done
With nightly-2021-05-09:
FAIL

With nightly-2021-05-10:
OK

With 1.88:
OK

which gives the following list of candidate commits. Not clear which one it is exactly but it doesn't matter much since we can confirm that the test works. I have confirmed locally that with nightly-2021-05-09 we get line: 0 for the last call.

click to expand
$ git log ^881c1ac408d93bb7adaa3a51dabab9266e82eee8 ca82264ec7556a6011b9d3f1b2fd4c7cd0bc8ae2 --no-merges --oneline

f25aa57 Remove unused opt_span_warn function
ebbc949 Note why Handler::fatal is different from Sesssion::fatal
96509b4 Make Diagnostic::span_fatal unconditionally raise an error
e49f447 Remove some unnecessary uses of struct_span_fatal
955fdae Rename Parser::span_fatal_err -> Parser::span_err
4b7c8b0 Add #[track_caller] to FakeDefId::expect_real()
ba13225 Remove FakeDefId::expect_local()
020d83d Enable -W semicolon_in_expressions_from_macros in bootstrap
1b928ff Update LLVM submodule
c2b15a6 Support -C passes in NewPM
5519cbf Don't force -O1 with ThinLTO
7c4989a Drop -opt-bisect-limit=0 flag from test
db140de Explicitly register GCOV profiling pass as well
5ecbe7f Explicitly register instrprof pass
0318883 Make -Z new-llvm-pass-manager an Option
0367e24 Avoid predecessors having Drop impls

@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 16, 2025
@wesleywiser
Copy link
Member

Thanks @Enselic!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 16, 2025

📌 Commit dd48e56 has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 16, 2025
fmease added a commit to fmease/rust that referenced this pull request Jul 17, 2025
…buginfo, r=wesleywiser

tests: Test line number in debuginfo for diverging function calls

Closes rust-lang#59558 which just [E-needs-test](rust-lang#59558 (comment)).

The bug seems to have been fixed in **nightly-2021-05-10**:

```sh
for toolchain in nightly-2021-05-09 \
                 nightly-2021-05-10 \
                 1.88; do
    echo -e "\nWith $toolchain:"
    rustc +$toolchain tests/codegen/diverging-function-call-debuginfo.rs --emit llvm-ir -o /tmp/out.ll -g -Clto -Copt-level=0
    build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck --input-file /tmp/out.ll tests/codegen/diverging-function-call-debuginfo.rs --check-prefix=CHECK --dump-input-context 10 2>/dev/null && echo OK || echo FAIL
done
```

```
With nightly-2021-05-09:
FAIL

With nightly-2021-05-10:
OK

With 1.88:
OK
```

which gives the following list of candidate commits. Not clear which one it is exactly but it doesn't matter much since we can confirm that the test works. I have confirmed locally that with **nightly-2021-05-09** we get `line: 0` for the last call.

<details>
<summary>click to expand</summary>

```
$ git log ^881c1ac408d93bb7adaa3a51dabab9266e82eee8 ca82264 --no-merges --oneline
```
f25aa57 Remove unused `opt_span_warn` function
ebbc949 Note why `Handler::fatal` is different from `Sesssion::fatal`
96509b4 Make `Diagnostic::span_fatal` unconditionally raise an error
e49f447 Remove some unnecessary uses of `struct_span_fatal`
955fdae Rename `Parser::span_fatal_err` -> `Parser::span_err`
4b7c8b0 Add `#[track_caller]` to `FakeDefId::expect_real()`
ba13225 Remove `FakeDefId::expect_local()`
020d83d Enable `-W semicolon_in_expressions_from_macros` in bootstrap
1b928ff Update LLVM submodule
c2b15a6 Support -C passes in NewPM
5519cbf Don't force -O1 with ThinLTO
7c4989a Drop -opt-bisect-limit=0 flag from test
db140de Explicitly register GCOV profiling pass as well
5ecbe7f Explicitly register instrprof pass
0318883 Make -Z new-llvm-pass-manager an Option<bool>
0367e24 Avoid predecessors having Drop impls

</details>
fmease added a commit to fmease/rust that referenced this pull request Jul 17, 2025
…buginfo, r=wesleywiser

tests: Test line number in debuginfo for diverging function calls

Closes rust-lang#59558 which just [E-needs-test](rust-lang#59558 (comment)).

The bug seems to have been fixed in **nightly-2021-05-10**:

```sh
for toolchain in nightly-2021-05-09 \
                 nightly-2021-05-10 \
                 1.88; do
    echo -e "\nWith $toolchain:"
    rustc +$toolchain tests/codegen/diverging-function-call-debuginfo.rs --emit llvm-ir -o /tmp/out.ll -g -Clto -Copt-level=0
    build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck --input-file /tmp/out.ll tests/codegen/diverging-function-call-debuginfo.rs --check-prefix=CHECK --dump-input-context 10 2>/dev/null && echo OK || echo FAIL
done
```

```
With nightly-2021-05-09:
FAIL

With nightly-2021-05-10:
OK

With 1.88:
OK
```

which gives the following list of candidate commits. Not clear which one it is exactly but it doesn't matter much since we can confirm that the test works. I have confirmed locally that with **nightly-2021-05-09** we get `line: 0` for the last call.

<details>
<summary>click to expand</summary>

```
$ git log ^881c1ac408d93bb7adaa3a51dabab9266e82eee8 ca82264 --no-merges --oneline
```
f25aa57 Remove unused `opt_span_warn` function
ebbc949 Note why `Handler::fatal` is different from `Sesssion::fatal`
96509b4 Make `Diagnostic::span_fatal` unconditionally raise an error
e49f447 Remove some unnecessary uses of `struct_span_fatal`
955fdae Rename `Parser::span_fatal_err` -> `Parser::span_err`
4b7c8b0 Add `#[track_caller]` to `FakeDefId::expect_real()`
ba13225 Remove `FakeDefId::expect_local()`
020d83d Enable `-W semicolon_in_expressions_from_macros` in bootstrap
1b928ff Update LLVM submodule
c2b15a6 Support -C passes in NewPM
5519cbf Don't force -O1 with ThinLTO
7c4989a Drop -opt-bisect-limit=0 flag from test
db140de Explicitly register GCOV profiling pass as well
5ecbe7f Explicitly register instrprof pass
0318883 Make -Z new-llvm-pass-manager an Option<bool>
0367e24 Avoid predecessors having Drop impls

</details>
bors added a commit that referenced this pull request Jul 17, 2025
Rollup of 15 pull requests

Successful merges:

 - #142300 (Disable `tests/run-make/mte-ffi` because no CI runners have MTE extensions enabled)
 - #143271 (Store the type of each GVN value)
 - #143293 (fix `-Zsanitizer=kcfi` on `#[naked]` functions)
 - #143719 (Emit warning when there is no space between `-o` and arg)
 - #143833 (Ban projecting into SIMD types [MCP838])
 - #143846 (pass --gc-sections if -Zexport-executable-symbols is enabled and improve tests)
 - #143879 (parse `const trait Trait`)
 - #143891 (Port `#[coverage]` to the new attribute system)
 - #143967 (constify `Option` methods)
 - #143985 (rustc_public: de-StableMIR-ize)
 - #144008 (Fix false positive double negations with macro invocation)
 - #144010 (Boostrap: add warning on `optimize = false`)
 - #144034 (tests: Test line number in debuginfo for diverging function calls)
 - #144049 (rustc-dev-guide subtree update)
 - #144056 (Copy GCC sources into the build directory even outside CI)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 17, 2025
…buginfo, r=wesleywiser

tests: Test line number in debuginfo for diverging function calls

Closes rust-lang#59558 which just [E-needs-test](rust-lang#59558 (comment)).

The bug seems to have been fixed in **nightly-2021-05-10**:

```sh
for toolchain in nightly-2021-05-09 \
                 nightly-2021-05-10 \
                 1.88; do
    echo -e "\nWith $toolchain:"
    rustc +$toolchain tests/codegen/diverging-function-call-debuginfo.rs --emit llvm-ir -o /tmp/out.ll -g -Clto -Copt-level=0
    build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck --input-file /tmp/out.ll tests/codegen/diverging-function-call-debuginfo.rs --check-prefix=CHECK --dump-input-context 10 2>/dev/null && echo OK || echo FAIL
done
```

```
With nightly-2021-05-09:
FAIL

With nightly-2021-05-10:
OK

With 1.88:
OK
```

which gives the following list of candidate commits. Not clear which one it is exactly but it doesn't matter much since we can confirm that the test works. I have confirmed locally that with **nightly-2021-05-09** we get `line: 0` for the last call.

<details>
<summary>click to expand</summary>

```
$ git log ^881c1ac408d93bb7adaa3a51dabab9266e82eee8 ca82264 --no-merges --oneline
```
f25aa57 Remove unused `opt_span_warn` function
ebbc949 Note why `Handler::fatal` is different from `Sesssion::fatal`
96509b4 Make `Diagnostic::span_fatal` unconditionally raise an error
e49f447 Remove some unnecessary uses of `struct_span_fatal`
955fdae Rename `Parser::span_fatal_err` -> `Parser::span_err`
4b7c8b0 Add `#[track_caller]` to `FakeDefId::expect_real()`
ba13225 Remove `FakeDefId::expect_local()`
020d83d Enable `-W semicolon_in_expressions_from_macros` in bootstrap
1b928ff Update LLVM submodule
c2b15a6 Support -C passes in NewPM
5519cbf Don't force -O1 with ThinLTO
7c4989a Drop -opt-bisect-limit=0 flag from test
db140de Explicitly register GCOV profiling pass as well
5ecbe7f Explicitly register instrprof pass
0318883 Make -Z new-llvm-pass-manager an Option<bool>
0367e24 Avoid predecessors having Drop impls

</details>
bors added a commit that referenced this pull request Jul 17, 2025
Rollup of 12 pull requests

Successful merges:

 - #142300 (Disable `tests/run-make/mte-ffi` because no CI runners have MTE extensions enabled)
 - #143271 (Store the type of each GVN value)
 - #143293 (fix `-Zsanitizer=kcfi` on `#[naked]` functions)
 - #143719 (Emit warning when there is no space between `-o` and arg)
 - #143846 (pass --gc-sections if -Zexport-executable-symbols is enabled and improve tests)
 - #143891 (Port `#[coverage]` to the new attribute system)
 - #143967 (constify `Option` methods)
 - #144008 (Fix false positive double negations with macro invocation)
 - #144010 (Boostrap: add warning on `optimize = false`)
 - #144034 (tests: Test line number in debuginfo for diverging function calls)
 - #144049 (rustc-dev-guide subtree update)
 - #144056 (Copy GCC sources into the build directory even outside CI)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 17, 2025
Rollup of 12 pull requests

Successful merges:

 - #142300 (Disable `tests/run-make/mte-ffi` because no CI runners have MTE extensions enabled)
 - #143271 (Store the type of each GVN value)
 - #143293 (fix `-Zsanitizer=kcfi` on `#[naked]` functions)
 - #143719 (Emit warning when there is no space between `-o` and arg)
 - #143846 (pass --gc-sections if -Zexport-executable-symbols is enabled and improve tests)
 - #143891 (Port `#[coverage]` to the new attribute system)
 - #143967 (constify `Option` methods)
 - #144008 (Fix false positive double negations with macro invocation)
 - #144010 (Boostrap: add warning on `optimize = false`)
 - #144034 (tests: Test line number in debuginfo for diverging function calls)
 - #144049 (rustc-dev-guide subtree update)
 - #144056 (Copy GCC sources into the build directory even outside CI)

r? `@ghost`
`@rustbot` modify labels: rollup
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 18, 2025
…buginfo, r=wesleywiser

tests: Test line number in debuginfo for diverging function calls

Closes rust-lang#59558 which just [E-needs-test](rust-lang#59558 (comment)).

The bug seems to have been fixed in **nightly-2021-05-10**:

```sh
for toolchain in nightly-2021-05-09 \
                 nightly-2021-05-10 \
                 1.88; do
    echo -e "\nWith $toolchain:"
    rustc +$toolchain tests/codegen/diverging-function-call-debuginfo.rs --emit llvm-ir -o /tmp/out.ll -g -Clto -Copt-level=0
    build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck --input-file /tmp/out.ll tests/codegen/diverging-function-call-debuginfo.rs --check-prefix=CHECK --dump-input-context 10 2>/dev/null && echo OK || echo FAIL
done
```

```
With nightly-2021-05-09:
FAIL

With nightly-2021-05-10:
OK

With 1.88:
OK
```

which gives the following list of candidate commits. Not clear which one it is exactly but it doesn't matter much since we can confirm that the test works. I have confirmed locally that with **nightly-2021-05-09** we get `line: 0` for the last call.

<details>
<summary>click to expand</summary>

```
$ git log ^881c1ac408d93bb7adaa3a51dabab9266e82eee8 ca82264 --no-merges --oneline
```
f25aa57 Remove unused `opt_span_warn` function
ebbc949 Note why `Handler::fatal` is different from `Sesssion::fatal`
96509b4 Make `Diagnostic::span_fatal` unconditionally raise an error
e49f447 Remove some unnecessary uses of `struct_span_fatal`
955fdae Rename `Parser::span_fatal_err` -> `Parser::span_err`
4b7c8b0 Add `#[track_caller]` to `FakeDefId::expect_real()`
ba13225 Remove `FakeDefId::expect_local()`
020d83d Enable `-W semicolon_in_expressions_from_macros` in bootstrap
1b928ff Update LLVM submodule
c2b15a6 Support -C passes in NewPM
5519cbf Don't force -O1 with ThinLTO
7c4989a Drop -opt-bisect-limit=0 flag from test
db140de Explicitly register GCOV profiling pass as well
5ecbe7f Explicitly register instrprof pass
0318883 Make -Z new-llvm-pass-manager an Option<bool>
0367e24 Avoid predecessors having Drop impls

</details>
@matthiaskrgr
Copy link
Member

@bors r-
#144075 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 18, 2025
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 19, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@jieyouxu
Copy link
Member

jieyouxu commented Jul 19, 2025

@Enselic output and failure on a x86_64-pc-windows-msvc host on this test (in case you find it useful):

<<<<<<
          1: ; ModuleID = 'diverging_function_call_debuginfo.b49ba236e3fc748d-cgu.0'
dag:12'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
dag:12'1                                                                              with "@LINE+1" equal to "13"
          2: source_filename = "diverging_function_call_debuginfo.b49ba236e3fc748d-cgu.0"
dag:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          3: target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
dag:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          4: target triple = "x86_64-pc-windows-msvc"
dag:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          5:
dag:12'0     ~
          6: @vtable.0 = private constant <{ [24 x i8], ptr, ptr, ptr }> <{ [24 x i8] c"\00\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00", ptr @"_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h9757838e76933bd6E", ptr @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h155ffa6faa142f45E", ptr @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h155ffa6faa142f45E" }>, align 8, !dbg !0
dag:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          7: @alloc_914b2c69d7eca30497b9feaf15ac92f1 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
dag:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dag:12'2                                                                           ?                                    possible intended match
          8: @alloc_8821998f047ca62cad40e6bc4e4d87c4 = private unnamed_addr constant [1 x i8] c"\01", align 1
dag:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          9: @alloc_476509aa7047bd805d630c6546685797 = private unnamed_addr constant [14 x i8] c"explicit panic", align 1
dag:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         10: @alloc_4520a62ffca62c8a923b4556f11a79fd = private unnamed_addr constant [65 x i8] c"X:\\repos\\rust\\tests\\codegen\\diverging-function-call-debuginfo.rs\00", align 1
dag:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         11: @alloc_0edb3682f1d157d187bec8b6fa80c10d = private unnamed_addr constant <{ ptr, [16 x i8] }> <{ ptr @alloc_4520a62ffca62c8a923b4556f11a79fd, [16 x i8] c"@\00\00\00\00\00\00\00\1D\00\00\00\05\00\00\00" }>, align 8
dag:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

diverging-function-call-debuginfo.zip

Maybe you need to first match main as a label first to filter out other stuff?

@Enselic
Copy link
Member Author

Enselic commented Jul 19, 2025

That's very helpful, thanks! The problem seems to be that x86_64-pc-windows-msvc does not have column: ... info. I need think a bit on how to deal with that...

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 22, 2025
@Mark-Simulacrum
Copy link
Member

@bors2 try jobs=aarch64-msvc-1

@rust-bors
Copy link

rust-bors bot commented Jul 27, 2025

⌛ Trying commit 54a4701 with merge 51f7869

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 27, 2025
…<try>

tests: Test line number in debuginfo for diverging function calls

try-job: aarch64-msvc-1
@rust-bors
Copy link

rust-bors bot commented Jul 27, 2025

☀️ Try build successful (CI)
Build commit: 51f7869 (51f7869577eefdee597a5582d4ebe7363c702969, parent: eed187cfce988dd669b7d9161f324433e64358ee)

@wesleywiser
Copy link
Member

Thanks @Enselic for getting that resolved!

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 28, 2025

📌 Commit 54a4701 has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 28, 2025
samueltardieu added a commit to samueltardieu/rust that referenced this pull request Jul 28, 2025
…buginfo, r=wesleywiser

tests: Test line number in debuginfo for diverging function calls

Closes rust-lang#59558 which just [E-needs-test](rust-lang#59558 (comment)).

The bug seems to have been fixed in **nightly-2021-05-10**:

```sh
for toolchain in nightly-2021-05-09 \
                 nightly-2021-05-10 \
                 1.88; do
    echo -e "\nWith $toolchain:"
    rustc +$toolchain tests/codegen/diverging-function-call-debuginfo.rs --emit llvm-ir -o /tmp/out.ll -g -Clto -Copt-level=0
    build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck --input-file /tmp/out.ll tests/codegen/diverging-function-call-debuginfo.rs --check-prefix=CHECK --dump-input-context 10 2>/dev/null && echo OK || echo FAIL
done
```

```
With nightly-2021-05-09:
FAIL

With nightly-2021-05-10:
OK

With 1.88:
OK
```

which gives the following list of candidate commits. Not clear which one it is exactly but it doesn't matter much since we can confirm that the test works. I have confirmed locally that with **nightly-2021-05-09** we get `line: 0` for the last call.

<details>
<summary>click to expand</summary>

```
$ git log ^881c1ac408d93bb7adaa3a51dabab9266e82eee8 ca82264 --no-merges --oneline
```
f25aa57 Remove unused `opt_span_warn` function
ebbc949 Note why `Handler::fatal` is different from `Sesssion::fatal`
96509b4 Make `Diagnostic::span_fatal` unconditionally raise an error
e49f447 Remove some unnecessary uses of `struct_span_fatal`
955fdae Rename `Parser::span_fatal_err` -> `Parser::span_err`
4b7c8b0 Add `#[track_caller]` to `FakeDefId::expect_real()`
ba13225 Remove `FakeDefId::expect_local()`
020d83d Enable `-W semicolon_in_expressions_from_macros` in bootstrap
1b928ff Update LLVM submodule
c2b15a6 Support -C passes in NewPM
5519cbf Don't force -O1 with ThinLTO
7c4989a Drop -opt-bisect-limit=0 flag from test
db140de Explicitly register GCOV profiling pass as well
5ecbe7f Explicitly register instrprof pass
0318883 Make -Z new-llvm-pass-manager an Option<bool>
0367e24 Avoid predecessors having Drop impls

</details>
bors added a commit that referenced this pull request Jul 29, 2025
Rollup of 11 pull requests

Successful merges:

 - #143289 (Remove `[T]::array_chunks(_mut)`)
 - #143883 (Add `--link-targets-dir` argument to linkchecker)
 - #144034 (tests: Test line number in debuginfo for diverging function calls)
 - #144236 (Add `core::mem::DropGuard`)
 - #144268 (Add method `find_ancestor_not_from_macro` and `find_ancestor_not_from_extern_macro` to supersede `find_oldest_ancestor_in_same_ctxt`)
 - #144303 (Consolidate staging for `rustc_private` tools)
 - #144539 (constify with_exposed_provenance)
 - #144569 (rustc-dev-guide subtree update)
 - #144573 (Raw Pointers are Constant PatKinds too)
 - #144578 (Ensure correct aligement of rustc_hir::Lifetime on platforms with lower default alignments.)
 - #144582 (fix `Atomic*::as_ptr` wording)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Jul 29, 2025
…buginfo, r=wesleywiser

tests: Test line number in debuginfo for diverging function calls

Closes rust-lang#59558 which just [E-needs-test](rust-lang#59558 (comment)).

The bug seems to have been fixed in **nightly-2021-05-10**:

```sh
for toolchain in nightly-2021-05-09 \
                 nightly-2021-05-10 \
                 1.88; do
    echo -e "\nWith $toolchain:"
    rustc +$toolchain tests/codegen/diverging-function-call-debuginfo.rs --emit llvm-ir -o /tmp/out.ll -g -Clto -Copt-level=0
    build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck --input-file /tmp/out.ll tests/codegen/diverging-function-call-debuginfo.rs --check-prefix=CHECK --dump-input-context 10 2>/dev/null && echo OK || echo FAIL
done
```

```
With nightly-2021-05-09:
FAIL

With nightly-2021-05-10:
OK

With 1.88:
OK
```

which gives the following list of candidate commits. Not clear which one it is exactly but it doesn't matter much since we can confirm that the test works. I have confirmed locally that with **nightly-2021-05-09** we get `line: 0` for the last call.

<details>
<summary>click to expand</summary>

```
$ git log ^881c1ac408d93bb7adaa3a51dabab9266e82eee8 ca82264 --no-merges --oneline
```
f25aa57 Remove unused `opt_span_warn` function
ebbc949 Note why `Handler::fatal` is different from `Sesssion::fatal`
96509b4 Make `Diagnostic::span_fatal` unconditionally raise an error
e49f447 Remove some unnecessary uses of `struct_span_fatal`
955fdae Rename `Parser::span_fatal_err` -> `Parser::span_err`
4b7c8b0 Add `#[track_caller]` to `FakeDefId::expect_real()`
ba13225 Remove `FakeDefId::expect_local()`
020d83d Enable `-W semicolon_in_expressions_from_macros` in bootstrap
1b928ff Update LLVM submodule
c2b15a6 Support -C passes in NewPM
5519cbf Don't force -O1 with ThinLTO
7c4989a Drop -opt-bisect-limit=0 flag from test
db140de Explicitly register GCOV profiling pass as well
5ecbe7f Explicitly register instrprof pass
0318883 Make -Z new-llvm-pass-manager an Option<bool>
0367e24 Avoid predecessors having Drop impls

</details>
@jieyouxu
Copy link
Member

Hi @Enselic, the codegen/ test suite was renamed to codegen-llvm/, you'll just need to move it. You can r= Wesley after moving the test.

@bors r-
@bors delegate+

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 29, 2025
@bors
Copy link
Collaborator

bors commented Jul 29, 2025

✌️ @Enselic, you can now approve this pull request!

If @jieyouxu told you to "r=me" after making some further change, please make that change, then do @bors r=@jieyouxu

@Enselic Enselic force-pushed the diverging-function-call-debuginfo branch from 54a4701 to 307fd41 Compare July 29, 2025 17:04
@Enselic
Copy link
Member Author

Enselic commented Jul 29, 2025

@bors r=wesleywiser

@bors
Copy link
Collaborator

bors commented Jul 29, 2025

📌 Commit 307fd41 has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 29, 2025
bors added a commit that referenced this pull request Jul 29, 2025
Rollup of 8 pull requests

Successful merges:

 - #144034 (tests: Test line number in debuginfo for diverging function calls)
 - #144510 (Fix Ord, Eq and Hash implementation of panic::Location)
 - #144583 (Enable T-compiler backport nomination)
 - #144586 (Update wasi-sdk to 27.0 in CI)
 - #144605 (Resolve: cachify `ExternPreludeEntry.binding` through a `Cell`)
 - #144632 (Update some tests for LLVM 21)
 - #144639 (Update rustc-perf submodule)
 - #144640 (Add support for the m68k architecture in 'object_architecture')

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 56bf50d into rust-lang:master Jul 30, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 30, 2025
rust-timer added a commit that referenced this pull request Jul 30, 2025
Rollup merge of #144034 - Enselic:diverging-function-call-debuginfo, r=wesleywiser

tests: Test line number in debuginfo for diverging function calls

Closes #59558 which just [E-needs-test](#59558 (comment)).

The bug seems to have been fixed in **nightly-2021-05-10**:

```sh
for toolchain in nightly-2021-05-09 \
                 nightly-2021-05-10 \
                 1.88; do
    echo -e "\nWith $toolchain:"
    rustc +$toolchain tests/codegen/diverging-function-call-debuginfo.rs --emit llvm-ir -o /tmp/out.ll -g -Clto -Copt-level=0
    build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck --input-file /tmp/out.ll tests/codegen/diverging-function-call-debuginfo.rs --check-prefix=CHECK --dump-input-context 10 2>/dev/null && echo OK || echo FAIL
done
```

```
With nightly-2021-05-09:
FAIL

With nightly-2021-05-10:
OK

With 1.88:
OK
```

which gives the following list of candidate commits. Not clear which one it is exactly but it doesn't matter much since we can confirm that the test works. I have confirmed locally that with **nightly-2021-05-09** we get `line: 0` for the last call.

<details>
<summary>click to expand</summary>

```
$ git log ^881c1ac408d93bb7adaa3a51dabab9266e82eee8 ca82264 --no-merges --oneline
```
f25aa57 Remove unused `opt_span_warn` function
ebbc949 Note why `Handler::fatal` is different from `Sesssion::fatal`
96509b4 Make `Diagnostic::span_fatal` unconditionally raise an error
e49f447 Remove some unnecessary uses of `struct_span_fatal`
955fdae Rename `Parser::span_fatal_err` -> `Parser::span_err`
4b7c8b0 Add `#[track_caller]` to `FakeDefId::expect_real()`
ba13225 Remove `FakeDefId::expect_local()`
020d83d Enable `-W semicolon_in_expressions_from_macros` in bootstrap
1b928ff Update LLVM submodule
c2b15a6 Support -C passes in NewPM
5519cbf Don't force -O1 with ThinLTO
7c4989a Drop -opt-bisect-limit=0 flag from test
db140de Explicitly register GCOV profiling pass as well
5ecbe7f Explicitly register instrprof pass
0318883 Make -Z new-llvm-pass-manager an Option<bool>
0367e24 Avoid predecessors having Drop impls

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing line information for calls to diverging functions
7 participants